/*******************************************************************************
 *
 * Copyright (c) 2004-2008 by Vivante Corp.  All rights reserved.
 *
 * The material in this file is confidential and contains trade secrets of
 * Vivante Corporation.  This is proprietary information owned by Vivante
 * Corporation.  No part of this work may be disclosed, reproduced, copied,
 * transmitted, or used in any way for any purpose, without the express
 * written permission of Vivante Corporation.
 *
 ******************************************************************************/

/*******************************************************************************
 *
 * This file is automatically generated on Mon Apr 13 01:22:32 2009
 *
 * Any changes made to this file are lost at the next compile run!
 * So better make sure you update the source .r files instead!
 *
 ******************************************************************************/

////////////////////////////////////////////////////////////////////////////////
//                          ~~~~~~~~~~~~~~~~~~~~~~~~                          //
//                          Module PrimitiveAssembly                          //
//                          ~~~~~~~~~~~~~~~~~~~~~~~~                          //
////////////////////////////////////////////////////////////////////////////////

// Register AQViewportXScale.
// ~~~~~~~~~~~~~~~~~~~~~~~~~
#define AQViewportXScaleRegAddrs                                          0x0280
#define AQ_VIEWPORT_XSCALE_Address                                       0x00A00
#define AQ_VIEWPORT_XSCALE_MSB                                                15
#define AQ_VIEWPORT_XSCALE_LSB                                                 0
#define AQ_VIEWPORT_XSCALE_Count                                               1
#define AQ_VIEWPORT_XSCALE_FieldMask                                  0xFFFFFFFF
#define AQ_VIEWPORT_XSCALE_ReadMask                                   0xFFFFFFFF
#define AQ_VIEWPORT_XSCALE_WriteMask                                  0xFFFFFFFF
#define AQ_VIEWPORT_XSCALE_ResetValue                                 0x00000000

// View port transform X scale value.
#define AQ_VIEWPORT_XSCALE_SCALE                                            31:0
#define AQ_VIEWPORT_XSCALE_SCALE_End                                          31
#define AQ_VIEWPORT_XSCALE_SCALE_Start                                         0

// Register AQViewportYScale.
// ~~~~~~~~~~~~~~~~~~~~~~~~~
#define AQViewportYScaleRegAddrs                                          0x0281
#define AQ_VIEWPORT_YSCALE_Address                                       0x00A04
#define AQ_VIEWPORT_YSCALE_MSB                                                15
#define AQ_VIEWPORT_YSCALE_LSB                                                 0
#define AQ_VIEWPORT_YSCALE_Count                                               1
#define AQ_VIEWPORT_YSCALE_FieldMask                                  0xFFFFFFFF
#define AQ_VIEWPORT_YSCALE_ReadMask                                   0xFFFFFFFF
#define AQ_VIEWPORT_YSCALE_WriteMask                                  0xFFFFFFFF
#define AQ_VIEWPORT_YSCALE_ResetValue                                 0x00000000

// View port transform X scale value.
#define AQ_VIEWPORT_YSCALE_SCALE                                            31:0
#define AQ_VIEWPORT_YSCALE_SCALE_End                                          31
#define AQ_VIEWPORT_YSCALE_SCALE_Start                                         0

// Register AQViewportZScale.
// ~~~~~~~~~~~~~~~~~~~~~~~~~
#define AQViewportZScaleRegAddrs                                          0x0282
#define AQ_VIEWPORT_ZSCALE_Address                                       0x00A08
#define AQ_VIEWPORT_ZSCALE_MSB                                                15
#define AQ_VIEWPORT_ZSCALE_LSB                                                 0
#define AQ_VIEWPORT_ZSCALE_Count                                               1
#define AQ_VIEWPORT_ZSCALE_FieldMask                                  0xFFFFFFFF
#define AQ_VIEWPORT_ZSCALE_ReadMask                                   0xFFFFFFFF
#define AQ_VIEWPORT_ZSCALE_WriteMask                                  0xFFFFFFFF
#define AQ_VIEWPORT_ZSCALE_ResetValue                                 0x00000000

// View port transform Z scale value.
#define AQ_VIEWPORT_ZSCALE_SCALE                                            31:0
#define AQ_VIEWPORT_ZSCALE_SCALE_End                                          31
#define AQ_VIEWPORT_ZSCALE_SCALE_Start                                         0

// Register AQViewportXOffset.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
#define AQViewportXOffsetRegAddrs                                         0x0283
#define AQ_VIEWPORT_XOFFSET_Address                                      0x00A0C
#define AQ_VIEWPORT_XOFFSET_MSB                                               15
#define AQ_VIEWPORT_XOFFSET_LSB                                                0
#define AQ_VIEWPORT_XOFFSET_Count                                              1
#define AQ_VIEWPORT_XOFFSET_FieldMask                                 0xFFFFFFFF
#define AQ_VIEWPORT_XOFFSET_ReadMask                                  0xFFFFFFFF
#define AQ_VIEWPORT_XOFFSET_WriteMask                                 0xFFFFFFFF
#define AQ_VIEWPORT_XOFFSET_ResetValue                                0x00000000

// View port transform X offset value.
#define AQ_VIEWPORT_XOFFSET_OFFSET                                          31:0
#define AQ_VIEWPORT_XOFFSET_OFFSET_End                                        31
#define AQ_VIEWPORT_XOFFSET_OFFSET_Start                                       0

// Register AQViewportYOffset.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
#define AQViewportYOffsetRegAddrs                                         0x0284
#define AQ_VIEWPORT_YOFFSET_Address                                      0x00A10
#define AQ_VIEWPORT_YOFFSET_MSB                                               15
#define AQ_VIEWPORT_YOFFSET_LSB                                                0
#define AQ_VIEWPORT_YOFFSET_Count                                              1
#define AQ_VIEWPORT_YOFFSET_FieldMask                                 0xFFFFFFFF
#define AQ_VIEWPORT_YOFFSET_ReadMask                                  0xFFFFFFFF
#define AQ_VIEWPORT_YOFFSET_WriteMask                                 0xFFFFFFFF
#define AQ_VIEWPORT_YOFFSET_ResetValue                                0x00000000

// View port transform Y offset value.
#define AQ_VIEWPORT_YOFFSET_OFFSET                                          31:0
#define AQ_VIEWPORT_YOFFSET_OFFSET_End                                        31
#define AQ_VIEWPORT_YOFFSET_OFFSET_Start                                       0

// Register AQViewportZOffset.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
#define AQViewportZOffsetRegAddrs                                         0x0285
#define AQ_VIEWPORT_ZOFFSET_Address                                      0x00A14
#define AQ_VIEWPORT_ZOFFSET_MSB                                               15
#define AQ_VIEWPORT_ZOFFSET_LSB                                                0
#define AQ_VIEWPORT_ZOFFSET_Count                                              1
#define AQ_VIEWPORT_ZOFFSET_FieldMask                                 0xFFFFFFFF
#define AQ_VIEWPORT_ZOFFSET_ReadMask                                  0xFFFFFFFF
#define AQ_VIEWPORT_ZOFFSET_WriteMask                                 0xFFFFFFFF
#define AQ_VIEWPORT_ZOFFSET_ResetValue                                0x00000000

// View port transform Z offset value.
#define AQ_VIEWPORT_ZOFFSET_OFFSET                                          31:0
#define AQ_VIEWPORT_ZOFFSET_OFFSET_End                                        31
#define AQ_VIEWPORT_ZOFFSET_OFFSET_Start                                       0

// Register AQPAClipAALineScale.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define AQPAClipAALineScaleRegAddrs                                       0x0286
#define AQPA_CLIP_AA_LINE_SCALE_Address                                  0x00A18
#define AQPA_CLIP_AA_LINE_SCALE_MSB                                           15
#define AQPA_CLIP_AA_LINE_SCALE_LSB                                            0
#define AQPA_CLIP_AA_LINE_SCALE_Count                                          1
#define AQPA_CLIP_AA_LINE_SCALE_FieldMask                             0xFFFFFFFF
#define AQPA_CLIP_AA_LINE_SCALE_ReadMask                              0xFFFFFFFF
#define AQPA_CLIP_AA_LINE_SCALE_WriteMask                             0xFFFFFFFF
#define AQPA_CLIP_AA_LINE_SCALE_ResetValue                            0x00000000

// Anti-alias line width scale (1/2 of the line width).
#define AQPA_CLIP_AA_LINE_SCALE_SCALE                                       31:0
#define AQPA_CLIP_AA_LINE_SCALE_SCALE_End                                     31
#define AQPA_CLIP_AA_LINE_SCALE_SCALE_Start                                    0

// Register AQPAClipPointSizeDivBy2.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define AQPAClipPointSizeDivBy2RegAddrs                                   0x0287
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_Address                             0x00A1C
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_MSB                                      15
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_LSB                                       0
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_Count                                     1
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_FieldMask                        0xFFFFFFFF
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_ReadMask                         0xFFFFFFFF
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_WriteMask                        0xFFFFFFFF
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_ResetValue                       0x00000000

// Point size value (1/2 of the size).
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_SCALE                                  31:0
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_SCALE_End                                31
#define AQPA_CLIP_POINT_SIZE_DIV_BY2_SCALE_Start                               0

// Register AQPAClipVT.
// ~~~~~~~~~~~~~~~~~~~

// legacy register, use AQPAClipVT30 and AQPAMasked instead.

#define AQPAClipVTRegAddrs                                                0x0288
#define AQ_PACLIPVT_Address                                              0x00A20
#define AQ_PACLIPVT_MSB                                                       15
#define AQ_PACLIPVT_LSB                                                        0
#define AQ_PACLIPVT_Count                                                      1
#define AQ_PACLIPVT_FieldMask                                         0x7FFFFFFF
#define AQ_PACLIPVT_ReadMask                                          0x7FFFFFFF
#define AQ_PACLIPVT_WriteMask                                         0x7FFFFFFF
#define AQ_PACLIPVT_ResetValue                                        0x00000000

// enable position (xyzw).
#define AQ_PACLIPVT_ENPOS                                                    0:0
#define AQ_PACLIPVT_ENPOS_End                                                  0
#define AQ_PACLIPVT_ENPOS_Start                                                0
#define   AQ_PACLIPVT_ENPOS_DISABLE                                          0x0
#define   AQ_PACLIPVT_ENPOS_ENABLE                                           0x1

// enable fog.
// not supported in gc430.
#define AQ_PACLIPVT_ENFOG                                                    1:1
#define AQ_PACLIPVT_ENFOG_End                                                  1
#define AQ_PACLIPVT_ENFOG_Start                                                1
#define   AQ_PACLIPVT_ENFOG_DISABLE                                          0x0
#define   AQ_PACLIPVT_ENFOG_ENABLE                                           0x1

// enable point size value as part of vertex data.
// value to be divided by 2 then replacing AQPAClipPointSizeDivBy2 as point size value.
#define AQ_PACLIPVT_ENPTSIZE                                                 2:2
#define AQ_PACLIPVT_ENPTSIZE_End                                               2
#define AQ_PACLIPVT_ENPTSIZE_Start                                             2
#define   AQ_PACLIPVT_ENPTSIZE_DISABLE                                       0x0
#define   AQ_PACLIPVT_ENPTSIZE_ENABLE                                        0x1

// enable color 0.
#define AQ_PACLIPVT_COLOR0                                                   3:3
#define AQ_PACLIPVT_COLOR0_End                                                 3
#define AQ_PACLIPVT_COLOR0_Start                                               3
#define   AQ_PACLIPVT_COLOR0_DISABLE                                         0x0
#define   AQ_PACLIPVT_COLOR0_ENABLE                                          0x1

// enable color 1.
#define AQ_PACLIPVT_COLOR1                                                   4:4
#define AQ_PACLIPVT_COLOR1_End                                                 4
#define AQ_PACLIPVT_COLOR1_Start                                               4
#define   AQ_PACLIPVT_COLOR1_DISABLE                                         0x0
#define   AQ_PACLIPVT_COLOR1_ENABLE                                          0x1

// enable texture 0.
#define AQ_PACLIPVT_TEXTURE0                                                 5:5
#define AQ_PACLIPVT_TEXTURE0_End                                               5
#define AQ_PACLIPVT_TEXTURE0_Start                                             5
#define   AQ_PACLIPVT_TEXTURE0_DISABLE                                       0x0
#define   AQ_PACLIPVT_TEXTURE0_ENABLE                                        0x1

// enable texture 1.
#define AQ_PACLIPVT_TEXTURE1                                                 6:6
#define AQ_PACLIPVT_TEXTURE1_End                                               6
#define AQ_PACLIPVT_TEXTURE1_Start                                             6
#define   AQ_PACLIPVT_TEXTURE1_DISABLE                                       0x0
#define   AQ_PACLIPVT_TEXTURE1_ENABLE                                        0x1

// enable texture 2.
#define AQ_PACLIPVT_TEXTURE2                                                 7:7
#define AQ_PACLIPVT_TEXTURE2_End                                               7
#define AQ_PACLIPVT_TEXTURE2_Start                                             7
#define   AQ_PACLIPVT_TEXTURE2_DISABLE                                       0x0
#define   AQ_PACLIPVT_TEXTURE2_ENABLE                                        0x1

// enable texture 3.
#define AQ_PACLIPVT_TEXTURE3                                                 8:8
#define AQ_PACLIPVT_TEXTURE3_End                                               8
#define AQ_PACLIPVT_TEXTURE3_Start                                             8
#define   AQ_PACLIPVT_TEXTURE3_DISABLE                                       0x0
#define   AQ_PACLIPVT_TEXTURE3_ENABLE                                        0x1

// enable texture 4.
#define AQ_PACLIPVT_TEXTURE4                                                 9:9
#define AQ_PACLIPVT_TEXTURE4_End                                               9
#define AQ_PACLIPVT_TEXTURE4_Start                                             9
#define   AQ_PACLIPVT_TEXTURE4_DISABLE                                       0x0
#define   AQ_PACLIPVT_TEXTURE4_ENABLE                                        0x1

// enable texture 5.
#define AQ_PACLIPVT_TEXTURE5                                               10:10
#define AQ_PACLIPVT_TEXTURE5_End                                              10
#define AQ_PACLIPVT_TEXTURE5_Start                                            10
#define   AQ_PACLIPVT_TEXTURE5_DISABLE                                       0x0
#define   AQ_PACLIPVT_TEXTURE5_ENABLE                                        0x1

// enable texture 6.
#define AQ_PACLIPVT_TEXTURE6                                               11:11
#define AQ_PACLIPVT_TEXTURE6_End                                              11
#define AQ_PACLIPVT_TEXTURE6_Start                                            11
#define   AQ_PACLIPVT_TEXTURE6_DISABLE                                       0x0
#define   AQ_PACLIPVT_TEXTURE6_ENABLE                                        0x1

// enable texture 7.
#define AQ_PACLIPVT_TEXTURE7                                               12:12
#define AQ_PACLIPVT_TEXTURE7_End                                              12
#define AQ_PACLIPVT_TEXTURE7_Start                                            12
#define   AQ_PACLIPVT_TEXTURE7_DISABLE                                       0x0
#define   AQ_PACLIPVT_TEXTURE7_ENABLE                                        0x1

// back face culling mode
#define AQ_PACLIPVT_CULLMODE                                               14:13
#define AQ_PACLIPVT_CULLMODE_End                                              14
#define AQ_PACLIPVT_CULLMODE_Start                                            13
#define   AQ_PACLIPVT_CULLMODE_NONE                                          0x0
#define   AQ_PACLIPVT_CULLMODE_CW                                            0x1
#define   AQ_PACLIPVT_CULLMODE_CCW                                           0x2

// triangle fill mode
#define AQ_PACLIPVT_FILLMODE                                               16:15
#define AQ_PACLIPVT_FILLMODE_End                                              16
#define AQ_PACLIPVT_FILLMODE_Start                                            15
#define   AQ_PACLIPVT_FILLMODE_POINT                                         0x0
#define   AQ_PACLIPVT_FILLMODE_WIREFRAME                                     0x1
#define   AQ_PACLIPVT_FILLMODE_SOLID                                         0x2

// triangle/line shade mode
#define AQ_PACLIPVT_SHADEMODE                                              18:17
#define AQ_PACLIPVT_SHADEMODE_End                                             18
#define AQ_PACLIPVT_SHADEMODE_Start                                           17
#define   AQ_PACLIPVT_SHADEMODE_FLAT                                         0x0
#define   AQ_PACLIPVT_SHADEMODE_GOURAUD                                      0x1

// texture wrap-around mode
#define AQ_PACLIPVT_TEXTUREWRAP                                            19:19
#define AQ_PACLIPVT_TEXTUREWRAP_End                                           19
#define AQ_PACLIPVT_TEXTUREWRAP_Start                                         19
#define   AQ_PACLIPVT_TEXTUREWRAP_DISABLE                                    0x0
#define   AQ_PACLIPVT_TEXTUREWRAP_ENABLE                                     0x1

// Point sprite mode
#define AQ_PACLIPVT_ENPTSPRITE                                             20:20
#define AQ_PACLIPVT_ENPTSPRITE_End                                            20
#define AQ_PACLIPVT_ENPTSPRITE_Start                                          20
#define   AQ_PACLIPVT_ENPTSPRITE_DISABLE                                     0x0
#define   AQ_PACLIPVT_ENPTSPRITE_ENABLE                                      0x1

// fog type, not supported in gc430
#define AQ_PACLIPVT_FOG_TYPE                                               22:21
#define AQ_PACLIPVT_FOG_TYPE_End                                              22
#define AQ_PACLIPVT_FOG_TYPE_Start                                            21

// input vertex is stranformed
#define AQ_PACLIPVT_ISTRANSFORM                                            23:23
#define AQ_PACLIPVT_ISTRANSFORM_End                                           23
#define AQ_PACLIPVT_ISTRANSFORM_Start                                         23
#define   AQ_PACLIPVT_ISTRANSFORM_DISABLE                                    0x0
#define   AQ_PACLIPVT_ISTRANSFORM_ENABLE                                     0x1

// anti alias line mode
#define AQ_PACLIPVT_ANTIALIASLINE                                          24:24
#define AQ_PACLIPVT_ANTIALIASLINE_End                                         24
#define AQ_PACLIPVT_ANTIALIASLINE_Start                                       24
#define   AQ_PACLIPVT_ANTIALIASLINE_DISABLE                                  0x0
#define   AQ_PACLIPVT_ANTIALIASLINE_ENABLE                                   0x1

// line per-pixel-clipping mode
#define AQ_PACLIPVT_CLIP_LINE_PER_PIXEL                                    25:25
#define AQ_PACLIPVT_CLIP_LINE_PER_PIXEL_End                                   25
#define AQ_PACLIPVT_CLIP_LINE_PER_PIXEL_Start                                 25
#define   AQ_PACLIPVT_CLIP_LINE_PER_PIXEL_DISABLE                            0x0
#define   AQ_PACLIPVT_CLIP_LINE_PER_PIXEL_ENABLE                             0x1

// selecting texture for anti-alias line
#define AQ_PACLIPVT_TEXFORAALINE                                           29:26
#define AQ_PACLIPVT_TEXFORAALINE_End                                          29
#define AQ_PACLIPVT_TEXFORAALINE_Start                                        26
#define   AQ_PACLIPVT_TEXFORAALINE_TEXTURE0                                  0x0
#define   AQ_PACLIPVT_TEXFORAALINE_TEXTURE1                                  0x1
#define   AQ_PACLIPVT_TEXFORAALINE_TEXTURE2                                  0x2
#define   AQ_PACLIPVT_TEXFORAALINE_TEXTURE3                                  0x3
#define   AQ_PACLIPVT_TEXFORAALINE_TEXTURE4                                  0x4
#define   AQ_PACLIPVT_TEXFORAALINE_TEXTURE5                                  0x5
#define   AQ_PACLIPVT_TEXFORAALINE_TEXTURE6                                  0x6
#define   AQ_PACLIPVT_TEXFORAALINE_TEXTURE7                                  0x7

// selecting W for depth clipping
#define AQ_PACLIPVT_CLIP_USE_W                                             30:30
#define AQ_PACLIPVT_CLIP_USE_W_End                                            30
#define AQ_PACLIPVT_CLIP_USE_W_Start                                          30
#define   AQ_PACLIPVT_CLIP_USE_W_DISABLE                                     0x0
#define   AQ_PACLIPVT_CLIP_USE_W_AUTOMATIC                                   0x1

// Register AQPrimType.
// ~~~~~~~~~~~~~~~~~~~
#define AQPrimTypeRegAddrs                                                0x0289
#define AQ_PRIM_TYPE_Address                                             0x00A24
#define AQ_PRIM_TYPE_MSB                                                      15
#define AQ_PRIM_TYPE_LSB                                                       0
#define AQ_PRIM_TYPE_Count                                                     1
#define AQ_PRIM_TYPE_FieldMask                                        0x0000000F
#define AQ_PRIM_TYPE_ReadMask                                         0x0000000F
#define AQ_PRIM_TYPE_WriteMask                                        0x0000000F
#define AQ_PRIM_TYPE_ResetValue                                       0x00000000

// Primitive type
#define AQ_PRIM_TYPE_PRIMTYPE                                                3:0
#define AQ_PRIM_TYPE_PRIMTYPE_End                                              3
#define AQ_PRIM_TYPE_PRIMTYPE_Start                                            0
#define   AQ_PRIM_TYPE_PRIMTYPE_POINT_LIST                                   0x1
#define   AQ_PRIM_TYPE_PRIMTYPE_LINE_LIST                                    0x2
#define   AQ_PRIM_TYPE_PRIMTYPE_LINE_STRIP                                   0x3
#define   AQ_PRIM_TYPE_PRIMTYPE_TRIANGLE_LIST                                0x4
#define   AQ_PRIM_TYPE_PRIMTYPE_TRIANGLE_STRIP                               0x5
#define   AQ_PRIM_TYPE_PRIMTYPE_TRIANGLE_FAN                                 0x6

// Register AQSystem.
// ~~~~~~~~~~~~~~~~~
#define AQSystemRegAddrs                                                  0x028A
#define AQ_SYSTEM_Address                                                0x00A28
#define AQ_SYSTEM_MSB                                                         15
#define AQ_SYSTEM_LSB                                                          0
#define AQ_SYSTEM_Count                                                        1
#define AQ_SYSTEM_FieldMask                                           0x00000013
#define AQ_SYSTEM_ReadMask                                            0x00000013
#define AQ_SYSTEM_WriteMask                                           0x00000013
#define AQ_SYSTEM_ResetValue                                          0x00000000

// system mode
#define AQ_SYSTEM_MODE                                                       1:0
#define AQ_SYSTEM_MODE_End                                                     1
#define AQ_SYSTEM_MODE_Start                                                   0
#define   AQ_SYSTEM_MODE_D3D                                                 0x0
#define   AQ_SYSTEM_MODE_GL                                                  0x1

// adding 0.5 to XY coordinate
#define AQ_SYSTEM_ADD_DOT5                                                   4:4
#define AQ_SYSTEM_ADD_DOT5_End                                                 4
#define AQ_SYSTEM_ADD_DOT5_Start                                               4
#define   AQ_SYSTEM_ADD_DOT5_OFF                                             0x0
#define   AQ_SYSTEM_ADD_DOT5_ON                                              0x1

// Register AQPAClipWplaneLimit.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define AQPAClipWplaneLimitRegAddrs                                       0x028B
#define AQPA_CLIP_WPLANE_LIMIT_Address                                   0x00A2C
#define AQPA_CLIP_WPLANE_LIMIT_MSB                                            15
#define AQPA_CLIP_WPLANE_LIMIT_LSB                                             0
#define AQPA_CLIP_WPLANE_LIMIT_Count                                           1
#define AQPA_CLIP_WPLANE_LIMIT_FieldMask                              0xFFFFFFFF
#define AQPA_CLIP_WPLANE_LIMIT_ReadMask                               0xFFFFFFFF
#define AQPA_CLIP_WPLANE_LIMIT_WriteMask                              0xFFFFFFFF
#define AQPA_CLIP_WPLANE_LIMIT_ResetValue                             0x00000000

// W clipping plane value
// used when ClipUseW set
#define AQPA_CLIP_WPLANE_LIMIT_VALUE                                        31:0
#define AQPA_CLIP_WPLANE_LIMIT_VALUE_End                                      31
#define AQPA_CLIP_WPLANE_LIMIT_VALUE_Start                                     0

// Register AQPAClipVT30.
// ~~~~~~~~~~~~~~~~~~~~~
#define AQPAClipVT30RegAddrs                                              0x028C
#define AQ_PACLIPVT30_Address                                            0x00A30
#define AQ_PACLIPVT30_MSB                                                     15
#define AQ_PACLIPVT30_LSB                                                      0
#define AQ_PACLIPVT30_Count                                                    1
#define AQ_PACLIPVT30_FieldMask                                       0x00000FFF
#define AQ_PACLIPVT30_ReadMask                                        0x00000FFF
#define AQ_PACLIPVT30_WriteMask                                       0x00000FFF
#define AQ_PACLIPVT30_ResetValue                                      0x00000000

// Bit 7:0 are reserved
#define AQ_PACLIPVT30_RESV_BITS                                              7:0
#define AQ_PACLIPVT30_RESV_BITS_End                                            7
#define AQ_PACLIPVT30_RESV_BITS_Start                                          0

// Number of enabled element attributes
#define AQ_PACLIPVT30_ELEMENT_COUNT                                         11:8
#define AQ_PACLIPVT30_ELEMENT_COUNT_End                                       11
#define AQ_PACLIPVT30_ELEMENT_COUNT_Start                                      8

// Register AQPAClipFlatColorTex (16 in total).
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Only use first 10, last 6 are reserved.

#define AQPAClipFlatColorTexRegAddrs                                      0x0290
#define AQPA_CLIP_FLAT_COLOR_TEX_Address                                 0x00A40
#define AQPA_CLIP_FLAT_COLOR_TEX_MSB                                          15
#define AQPA_CLIP_FLAT_COLOR_TEX_LSB                                           4
#define AQPA_CLIP_FLAT_COLOR_TEX_Count                                        16
#define AQPA_CLIP_FLAT_COLOR_TEX_FieldMask                            0x00000FF1
#define AQPA_CLIP_FLAT_COLOR_TEX_ReadMask                             0x00000FF1
#define AQPA_CLIP_FLAT_COLOR_TEX_WriteMask                            0x00000FF1
#define AQPA_CLIP_FLAT_COLOR_TEX_ResetValue                           0x00000000

#define AQPA_CLIP_FLAT_COLOR_TEX_TYPE                                        0:0
#define AQPA_CLIP_FLAT_COLOR_TEX_TYPE_End                                      0
#define AQPA_CLIP_FLAT_COLOR_TEX_TYPE_Start                                    0
#define   AQPA_CLIP_FLAT_COLOR_TEX_TYPE_COLOR                                0x0
// 0: color, 1: texture or other.
#define   AQPA_CLIP_FLAT_COLOR_TEX_TYPE_NOTCOLOR                             0x1

// Bit 5 represents y, 1: texture, 0: other
// Bit 6 represents z, 1: texture, 0: other
// Bit 7 represents w, 1: texture, 0: other
#define AQPA_CLIP_FLAT_COLOR_TEX_COMPONENT                                   7:4
#define AQPA_CLIP_FLAT_COLOR_TEX_COMPONENT_End                                 7
#define AQPA_CLIP_FLAT_COLOR_TEX_COMPONENT_Start                               4
#define   AQPA_CLIP_FLAT_COLOR_TEX_COMPONENT_DISABLE                         0x0
// Bit 4 represents x, 1: texture, 0: other
#define   AQPA_CLIP_FLAT_COLOR_TEX_COMPONENT_ENABLE                          0x1

// Bit 9 represents y, for textures only
// Bit 10 represents z, for textures only
// Bit 11 represents w, for textures only
#define AQPA_CLIP_FLAT_COLOR_TEX_COORD                                      11:8
#define AQPA_CLIP_FLAT_COLOR_TEX_COORD_End                                    11
#define AQPA_CLIP_FLAT_COLOR_TEX_COORD_Start                                   8
#define   AQPA_CLIP_FLAT_COLOR_TEX_COORD_U                                   0x0
// Bit 8 represents x, for textures only
#define   AQPA_CLIP_FLAT_COLOR_TEX_COORD_V                                   0x1

// Register AQPAMasked.
// ~~~~~~~~~~~~~~~~~~~
#define AQPAMaskedRegAddrs                                                0x028D
#define AQPA_MASKED_Address                                              0x00A34
#define AQPA_MASKED_MSB                                                       15
#define AQPA_MASKED_LSB                                                        0
#define AQPA_MASKED_Count                                                      1
#define AQPA_MASKED_FieldMask                                         0x7FF7773F
#define AQPA_MASKED_ReadMask                                          0x7FF7773F
#define AQPA_MASKED_WriteMask                                         0x7FF7773F
#define AQPA_MASKED_ResetValue                                        0x00000000

// Bit 0, 1 are reserved
#define AQPA_MASKED_RESV_BITS                                                1:0
#define AQPA_MASKED_RESV_BITS_End                                              1
#define AQPA_MASKED_RESV_BITS_Start                                            0

// enable point size value as part of vertex data.
// value to be divided by 2 then replacing AQPAClipPointSizeDivBy2 as point size value.
#define AQPA_MASKED_ENABLE_POINT_SIZE                                        2:2
#define AQPA_MASKED_ENABLE_POINT_SIZE_End                                      2
#define AQPA_MASKED_ENABLE_POINT_SIZE_Start                                    2
#define   AQPA_MASKED_ENABLE_POINT_SIZE_DISABLE                              0x0
#define   AQPA_MASKED_ENABLE_POINT_SIZE_ENABLE                               0x1

// Mask bit 2.
#define AQPA_MASKED_MASK_ENABLE_POINT_SIZE                                   3:3
#define AQPA_MASKED_MASK_ENABLE_POINT_SIZE_End                                 3
#define AQPA_MASKED_MASK_ENABLE_POINT_SIZE_Start                               3
#define   AQPA_MASKED_MASK_ENABLE_POINT_SIZE_ENABLED                         0x0
#define   AQPA_MASKED_MASK_ENABLE_POINT_SIZE_MASKED                          0x1

// Point sprite mode
#define AQPA_MASKED_ENABLE_POINT_SPRITE                                      4:4
#define AQPA_MASKED_ENABLE_POINT_SPRITE_End                                    4
#define AQPA_MASKED_ENABLE_POINT_SPRITE_Start                                  4
#define   AQPA_MASKED_ENABLE_POINT_SPRITE_DISABLED                           0x0
#define   AQPA_MASKED_ENABLE_POINT_SPRITE_ENABLED                            0x1

// Mask bit 4.
#define AQPA_MASKED_MASK_ENABLE_POINT_SPRITE                                 5:5
#define AQPA_MASKED_MASK_ENABLE_POINT_SPRITE_End                               5
#define AQPA_MASKED_MASK_ENABLE_POINT_SPRITE_Start                             5
#define   AQPA_MASKED_MASK_ENABLE_POINT_SPRITE_ENABLED                       0x0
#define   AQPA_MASKED_MASK_ENABLE_POINT_SPRITE_MASKED                        0x1

// back face culling mode
#define AQPA_MASKED_CULL_MODE                                                9:8
#define AQPA_MASKED_CULL_MODE_End                                              9
#define AQPA_MASKED_CULL_MODE_Start                                            8
#define   AQPA_MASKED_CULL_MODE_NONE                                         0x0
#define   AQPA_MASKED_CULL_MODE_CW                                           0x1
#define   AQPA_MASKED_CULL_MODE_CCW                                          0x2

// Mask bits 9:8.
#define AQPA_MASKED_MASK_CULL_MODE                                         10:10
#define AQPA_MASKED_MASK_CULL_MODE_End                                        10
#define AQPA_MASKED_MASK_CULL_MODE_Start                                      10
#define   AQPA_MASKED_MASK_CULL_MODE_ENABLED                                 0x0
#define   AQPA_MASKED_MASK_CULL_MODE_MASKED                                  0x1

// triangle fill mode
#define AQPA_MASKED_FILL_MODE                                              13:12
#define AQPA_MASKED_FILL_MODE_End                                             13
#define AQPA_MASKED_FILL_MODE_Start                                           12
#define   AQPA_MASKED_FILL_MODE_POINT                                        0x0
#define   AQPA_MASKED_FILL_MODE_WIREFRAME                                    0x1
#define   AQPA_MASKED_FILL_MODE_SOLID                                        0x2

// Mask bits 13:12.
#define AQPA_MASKED_MASK_FILL_MODE                                         14:14
#define AQPA_MASKED_MASK_FILL_MODE_End                                        14
#define AQPA_MASKED_MASK_FILL_MODE_Start                                      14
#define   AQPA_MASKED_MASK_FILL_MODE_ENABLED                                 0x0
#define   AQPA_MASKED_MASK_FILL_MODE_MASKED                                  0x1

// triangle/line shade mode
#define AQPA_MASKED_SHADE_MODE                                             17:16
#define AQPA_MASKED_SHADE_MODE_End                                            17
#define AQPA_MASKED_SHADE_MODE_Start                                          16
#define   AQPA_MASKED_SHADE_MODE_FLAT                                        0x0
#define   AQPA_MASKED_SHADE_MODE_GOURAUD                                     0x1

// Mask bits 17:16.
#define AQPA_MASKED_MASK_SHADE_MODE                                        18:18
#define AQPA_MASKED_MASK_SHADE_MODE_End                                       18
#define AQPA_MASKED_MASK_SHADE_MODE_Start                                     18
#define   AQPA_MASKED_MASK_SHADE_MODE_ENABLED                                0x0
#define   AQPA_MASKED_MASK_SHADE_MODE_MASKED                                 0x1

// input vertex is stranformed
#define AQPA_MASKED_IS_TRANSFORMED                                         20:20
#define AQPA_MASKED_IS_TRANSFORMED_End                                        20
#define AQPA_MASKED_IS_TRANSFORMED_Start                                      20
#define   AQPA_MASKED_IS_TRANSFORMED_DISABLE                                 0x0
#define   AQPA_MASKED_IS_TRANSFORMED_ENABLE                                  0x1

// Mask bit 20.
#define AQPA_MASKED_MASK_IS_TRANSFORMED                                    21:21
#define AQPA_MASKED_MASK_IS_TRANSFORMED_End                                   21
#define AQPA_MASKED_MASK_IS_TRANSFORMED_Start                                 21
#define   AQPA_MASKED_MASK_IS_TRANSFORMED_ENABLED                            0x0
#define   AQPA_MASKED_MASK_IS_TRANSFORMED_MASKED                             0x1

// anti alias line mode
#define AQPA_MASKED_ANTI_ALIAS_LINE                                        22:22
#define AQPA_MASKED_ANTI_ALIAS_LINE_End                                       22
#define AQPA_MASKED_ANTI_ALIAS_LINE_Start                                     22
#define   AQPA_MASKED_ANTI_ALIAS_LINE_DISABLE                                0x0
#define   AQPA_MASKED_ANTI_ALIAS_LINE_ENABLE                                 0x1

// Mask bit 22.
#define AQPA_MASKED_MASK_ANTI_ALIAS_LINE                                   23:23
#define AQPA_MASKED_MASK_ANTI_ALIAS_LINE_End                                  23
#define AQPA_MASKED_MASK_ANTI_ALIAS_LINE_Start                                23
#define   AQPA_MASKED_MASK_ANTI_ALIAS_LINE_ENABLED                           0x0
#define   AQPA_MASKED_MASK_ANTI_ALIAS_LINE_MASKED                            0x1

// selecting texture for anti-alias line
#define AQPA_MASKED_TEXTURE_FOR_ANTI_ALIAS_LINE                            27:24
#define AQPA_MASKED_TEXTURE_FOR_ANTI_ALIAS_LINE_End                           27
#define AQPA_MASKED_TEXTURE_FOR_ANTI_ALIAS_LINE_Start                         24

// Mask bits 27:24.
#define AQPA_MASKED_MASK_TEXTURE_FOR_ANTI_ALIAS_LINE                       28:28
#define AQPA_MASKED_MASK_TEXTURE_FOR_ANTI_ALIAS_LINE_End                      28
#define AQPA_MASKED_MASK_TEXTURE_FOR_ANTI_ALIAS_LINE_Start                    28
#define   AQPA_MASKED_MASK_TEXTURE_FOR_ANTI_ALIAS_LINE_ENABLED               0x0
#define   AQPA_MASKED_MASK_TEXTURE_FOR_ANTI_ALIAS_LINE_MASKED                0x1

// selecting W for depth clipping
#define AQPA_MASKED_CLIP_USE_W                                             29:29
#define AQPA_MASKED_CLIP_USE_W_End                                            29
#define AQPA_MASKED_CLIP_USE_W_Start                                          29
#define   AQPA_MASKED_CLIP_USE_W_DISABLE                                     0x0
#define   AQPA_MASKED_CLIP_USE_W_AUTOMATIC                                   0x1

// Mask bit 29.
#define AQPA_MASKED_MASK_CLIP_USE_W                                        30:30
#define AQPA_MASKED_MASK_CLIP_USE_W_End                                       30
#define AQPA_MASKED_MASK_CLIP_USE_W_Start                                     30
#define   AQPA_MASKED_MASK_CLIP_USE_W_ENABLED                                0x0
#define   AQPA_MASKED_MASK_CLIP_USE_W_MASKED                                 0x1

////////////////////////////////////////////////////////////////////////////////
//                            ~~~~~~~~~~~~~~~~~~~~~                           //
//                            Command AQPA_Template                           //
//                            ~~~~~~~~~~~~~~~~~~~~~                           //
////////////////////////////////////////////////////////////////////////////////

// Define AQPAXyClamp.
// ~~~~~~~~~~~~~~~~~~
#define   AQPA_XY_CLAMP_MIN                                           0xCAFFFFFE
#define   AQPA_XY_CLAMP_MAX                                           0x4AFFFFFE

// Define AQPADefaultState.
// ~~~~~~~~~~~~~~~~~~~~~~~
#define   AQPA_DEFAULT_STATE_LINE_WIDTH_SCALE                         0x3F400000
#define   AQPA_DEFAULT_STATE_XSCALE                                   0x43200000
#define   AQPA_DEFAULT_STATE_YSCALE                                   0xC2F00000
#define   AQPA_DEFAULT_STATE_ZSCALE                                   0x3F800000
#define   AQPA_DEFAULT_STATE_XOFFSET                                  0x43200000
#define   AQPA_DEFAULT_STATE_YOFFSET                                  0x42F00000
#define   AQPA_DEFAULT_STATE_ZOFFSET                                  0x00000000
#define   AQPA_DEFAULT_STATE_PNT_SIZE_DIV_BY2                         0x3F000000
#define   AQPA_DEFAULT_STATE_FILLMODE                                 0x00000002
#define   AQPA_DEFAULT_STATE_ELEMENT_NUM                              0x00000001
#define   AQPA_DEFAULT_STATE_W_LIMIT                                  0x3E000000

